var mongoose = require("mongoose");
module.exports.Adminer=async function(){
    return await mongoose.model("adminModel").find();
}
module.exports.addadmin=async function({adminName,password}){
    await mongoose.model('adminModel').create({adminName:adminName,password:password})
}
//删除商家
module.exports.dilet=async function(data){
    await mongoose.model('adminModel').deleteOne(data)
}
//显示修改数据
module.exports.gaiadmin=async function(data){
    return await mongoose.model('adminModel').find({_id:data})
}
//修改数据
module.exports.submitadminer=async function({data}){
    await mongoose.model('adminModel').updateOne({_id:data._id},data)
}